3.167 \(\int \sec (e+f x) (a+b \sec ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=91 \[ \frac {\left (8 a^2+8 a b+3 b^2\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac {3 b (2 a+b) \tan (e+f x) \sec (e+f x)}{8 f}+\frac {b \tan (e+f x) \sec ^3(e+f x) \left (-a \sin ^2(e+f x)+a+b\right )}{4 f} \]

[Out]

1/8*(8*a^2+8*a*b+3*b^2)*arctanh(sin(f*x+e))/f+3/8*b*(2*a+b)*sec(f*x+e)*tan(f*x+e)/f+1/4*b*sec(f*x+e)^3*(a+b-a*
sin(f*x+e)^2)*tan(f*x+e)/f

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {4147, 413, 385, 206} \[ \frac {\left (8 a^2+8 a b+3 b^2\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac {3 b (2 a+b) \tan (e+f x) \sec (e+f x)}{8 f}+\frac {b \tan (e+f x) \sec ^3(e+f x) \left (-a \sin ^2(e+f x)+a+b\right )}{4 f} \]

Antiderivative was successfully verified.

[In]

Int[Sec[e + f*x]*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

((8*a^2 + 8*a*b + 3*b^2)*ArcTanh[Sin[e + f*x]])/(8*f) + (3*b*(2*a + b)*Sec[e + f*x]*Tan[e + f*x])/(8*f) + (b*S
ec[e + f*x]^3*(a + b - a*Sin[e + f*x]^2)*Tan[e + f*x])/(4*f)

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 413

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[((a*d - c*b)*x*(a + b*x^n)^
(p + 1)*(c + d*x^n)^(q - 1))/(a*b*n*(p + 1)), x] - Dist[1/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1)*(c + d*x^n)
^(q - 2)*Simp[c*(a*d - c*b*(n*(p + 1) + 1)) + d*(a*d*(n*(q - 1) + 1) - b*c*(n*(p + q) + 1))*x^n, x], x], x] /;
 FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, n, p, q
, x]

Rule 4147

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = Fr
eeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 - ff^2*x^2)^
((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n
/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \sec (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {\left (a+b-a x^2\right )^2}{\left (1-x^2\right )^3} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac {b \sec ^3(e+f x) \left (a+b-a \sin ^2(e+f x)\right ) \tan (e+f x)}{4 f}-\frac {\operatorname {Subst}\left (\int \frac {-(a+b) (4 a+3 b)+a (4 a+b) x^2}{\left (1-x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{4 f}\\ &=\frac {3 b (2 a+b) \sec (e+f x) \tan (e+f x)}{8 f}+\frac {b \sec ^3(e+f x) \left (a+b-a \sin ^2(e+f x)\right ) \tan (e+f x)}{4 f}+\frac {\left (8 a^2+8 a b+3 b^2\right ) \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (e+f x)\right )}{8 f}\\ &=\frac {\left (8 a^2+8 a b+3 b^2\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac {3 b (2 a+b) \sec (e+f x) \tan (e+f x)}{8 f}+\frac {b \sec ^3(e+f x) \left (a+b-a \sin ^2(e+f x)\right ) \tan (e+f x)}{4 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.14, size = 63, normalized size = 0.69 \[ \frac {\left (8 a^2+8 a b+3 b^2\right ) \tanh ^{-1}(\sin (e+f x))+b \tan (e+f x) \sec (e+f x) \left (8 a+2 b \sec ^2(e+f x)+3 b\right )}{8 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[e + f*x]*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

((8*a^2 + 8*a*b + 3*b^2)*ArcTanh[Sin[e + f*x]] + b*Sec[e + f*x]*(8*a + 3*b + 2*b*Sec[e + f*x]^2)*Tan[e + f*x])
/(8*f)

________________________________________________________________________________________

fricas [A]  time = 0.62, size = 116, normalized size = 1.27 \[ \frac {{\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} \cos \left (f x + e\right )^{4} \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} \cos \left (f x + e\right )^{4} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left ({\left (8 \, a b + 3 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, b^{2}\right )} \sin \left (f x + e\right )}{16 \, f \cos \left (f x + e\right )^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/16*((8*a^2 + 8*a*b + 3*b^2)*cos(f*x + e)^4*log(sin(f*x + e) + 1) - (8*a^2 + 8*a*b + 3*b^2)*cos(f*x + e)^4*lo
g(-sin(f*x + e) + 1) + 2*((8*a*b + 3*b^2)*cos(f*x + e)^2 + 2*b^2)*sin(f*x + e))/(f*cos(f*x + e)^4)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*((-8*a^2-8*a*b-3*b^2)/32*ln(abs(sin(f*x+exp(1))-1))-(-8*a^
2-8*a*b-3*b^2)/32*ln(abs(sin(f*x+exp(1))+1))-(8*sin(f*x+exp(1))^3*a*b+3*sin(f*x+exp(1))^3*b^2-8*sin(f*x+exp(1)
)*a*b-5*sin(f*x+exp(1))*b^2)*1/16/(sin(f*x+exp(1))^2-1)^2)

________________________________________________________________________________________

maple [A]  time = 1.15, size = 125, normalized size = 1.37 \[ \frac {a^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}+\frac {a b \tan \left (f x +e \right ) \sec \left (f x +e \right )}{f}+\frac {a b \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}+\frac {b^{2} \tan \left (f x +e \right ) \left (\sec ^{3}\left (f x +e \right )\right )}{4 f}+\frac {3 b^{2} \sec \left (f x +e \right ) \tan \left (f x +e \right )}{8 f}+\frac {3 b^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8 f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)*(a+b*sec(f*x+e)^2)^2,x)

[Out]

1/f*a^2*ln(sec(f*x+e)+tan(f*x+e))+1/f*a*b*tan(f*x+e)*sec(f*x+e)+1/f*a*b*ln(sec(f*x+e)+tan(f*x+e))+1/4/f*b^2*ta
n(f*x+e)*sec(f*x+e)^3+3/8*b^2*sec(f*x+e)*tan(f*x+e)/f+3/8/f*b^2*ln(sec(f*x+e)+tan(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.33, size = 119, normalized size = 1.31 \[ \frac {{\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} \log \left (\sin \left (f x + e\right ) - 1\right ) - \frac {2 \, {\left ({\left (8 \, a b + 3 \, b^{2}\right )} \sin \left (f x + e\right )^{3} - {\left (8 \, a b + 5 \, b^{2}\right )} \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1}}{16 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/16*((8*a^2 + 8*a*b + 3*b^2)*log(sin(f*x + e) + 1) - (8*a^2 + 8*a*b + 3*b^2)*log(sin(f*x + e) - 1) - 2*((8*a*
b + 3*b^2)*sin(f*x + e)^3 - (8*a*b + 5*b^2)*sin(f*x + e))/(sin(f*x + e)^4 - 2*sin(f*x + e)^2 + 1))/f

________________________________________________________________________________________

mupad [B]  time = 4.46, size = 86, normalized size = 0.95 \[ \frac {\mathrm {atanh}\left (\sin \left (e+f\,x\right )\right )\,\left (a^2+a\,b+\frac {3\,b^2}{8}\right )}{f}+\frac {\sin \left (e+f\,x\right )\,\left (\frac {5\,b^2}{8}+a\,b\right )-{\sin \left (e+f\,x\right )}^3\,\left (\frac {3\,b^2}{8}+a\,b\right )}{f\,\left ({\sin \left (e+f\,x\right )}^4-2\,{\sin \left (e+f\,x\right )}^2+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b/cos(e + f*x)^2)^2/cos(e + f*x),x)

[Out]

(atanh(sin(e + f*x))*(a*b + a^2 + (3*b^2)/8))/f + (sin(e + f*x)*(a*b + (5*b^2)/8) - sin(e + f*x)^3*(a*b + (3*b
^2)/8))/(f*(sin(e + f*x)^4 - 2*sin(e + f*x)^2 + 1))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2} \sec {\left (e + f x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+b*sec(f*x+e)**2)**2,x)

[Out]

Integral((a + b*sec(e + f*x)**2)**2*sec(e + f*x), x)

________________________________________________________________________________________